02. A Library You've Already Used
A Library You've Already Used
The first library you've been using is the Support Library, which provides backwards compatibility for newer features of Android. Additionally, it provides convenience classes and features not available in the standard Framework API for easier development and support across more devices.
One example of the Support Library in action is the use of Runtime Permissions. The old permissions model requested the desired permission when the app was installed. Starting with API level 23, however, the permissions are requested as they are needed. This approach streamlines the app install process, since the user does not need to grant permissions when they install or update the app. It also gives the user more control over the app's functionality; for example, a user could choose to give a the Google+ app access to the contacts but not to the device location or camera.
The Support Library includes methods for checking for existing permissions, and requesting new permissions in a backwards compatible way: It will only affect devices running API level 23 or higher, so you don't have to do any API level checks yourself.
The Support Library is very large, so including the entire library when all you want is compatible support for runtime permissions is almost certainly overkill. This is why the Support Library is fragmented into many different packages based on functionality, so you can include only the features that your application requires (remember how you included only the RecyclerView statement from the Support Library earlier).
For a complete list of packages and their uses, check out the Support Library docs.